<ion-view class="bg">
  <ion-header-bar class="bar bar-positive">
    <button class="button back-button buttons icon ion-ios-arrow-left button-clear" nav-direction="back" ui-sref="tab.workbench">返回</button>
    <h3 class="title">下单</h3>
  </ion-header-bar>
  <ion-content>
      <div class="list card">
          <div class="item item-input div">
            <i class="input-label" >物流公司</i>
            <input type="text" class="txtRight" ng-model="order.companyName" placeholder="请选择承运公司" ng-click="modal.show()" readonly>
          </div>
          <div class="item item-input item-divider div">
              <img src="img/shr_logo.png" class="typeIcon" style="height: 25px;">
              <i class="dark">收货人</i>
          </div>
          <li class="item li" ng-click="goChooseReceive()" ng-if="defaultAddress.consigNee!=null">
            <div class="address-name">
              <i>{{order.consigneeName}}</i>
              <i style="margin-left: 10px;">{{order.consigneePhone}}</i>
              <img src="img/default.png">
            </div>
            <div>
              <p style="color: #999;max-width: 90%;">{{order.consigneeDetailAddress}}</p>
            </div>
            <i class="ion-chevron-right address-chevron-right"></i>
          </li>
          <li class="item li" ng-click="goChooseReceive()" ng-if="defaultAddress.consigNee==null" style="height: 84px;">
            <div style="text-align: center;margin-top: 16px;color: #999;">请添加收货地址</div>
            <i class="ion-chevron-right address-chevron-right"></i>
          </li>
          <div class="item item-input item-divider div">
              <img src="img/fhr_logo.png" class="typeIcon" style="height: 25px;">
              <i class="dark">发货人</i>
          </div>
          <li class="item li" ng-click="goChooseShipper()" ng-if="defaultAddress.shipper!=null">
            <div class="address-name">
              <i>{{order.consignorName}}</i>
              <i style="margin-left: 10px;">{{order.consignorPhone}}</i>
              <img src="img/default.png">
            </div>
            <div>
              <p style="color: #999;max-width: 90%;">{{order.consignorDetailAddress}}</p>
            </div>
            <i class="ion-chevron-right address-chevron-right"></i>
          </li>
          <li class="item li" ng-click="goChooseShipper()" ng-if="defaultAddress.shipper==null" style="height: 84px;">
            <div style="text-align: center;margin-top: 16px;color: #999;">请添加发货地址</div>
            <i class="ion-chevron-right address-chevron-right"></i>
          </li>
          <div class="item item-input item-divider div">
              <img src="img/fhxx_logo.png" class="typeIcon" style="height: 25px;">
              <i class="dark">发货信息</i>
          </div>
          <div class="item item-input div">
            <input type="text" class="col-50" placeholder="货物名称" maxlength="7" ng-model="order.goodsInfo.goodsName">
            <input type="number" class="col-50" placeholder="货物件数" ng-model="order.goodsInfo.pieces" onkeyup="this.value=this.value.replace(/\D/g,'')" onkeypress="this.value = this.value.slice(0, 7)" style="margin-left: 32px;">
            <span class="company">件</span>
          </div>
          <div class="item item-input div">
            <input type="number" class="col-50 twoDot" id="weight" placeholder="货物重量" ng-model="order.goodsInfo.weight" onkeypress="this.value = this.value.slice(0, 7)">
            <span class="company">Kg</span>
            <input type="number" class="col-50 twoDot" id="volume" placeholder="货物体积" ng-model="order.goodsInfo.volume" onkeypress="this.value = this.value.slice(0, 7)">
            <span class="company">㎥</span>
          </div>
          <label class="item item-input item-select div">
            <i class="input-label col-25">包装</i>
            <select id="GOODS_PACK">
              <option ng-repeat="i in packTypes" value="{{i.key}}">{{i.value}}</option>
            </select>
          </label>
          <label class="item item-input item-select div">
            <i class="input-label col-25" >提货方式</i>
            <select id="DELIVERY_TYPE">
              <option selected value="0">自提</option>
              <option value="1">送货</option>
              <option value="2">上楼</option>
            </select>
          </label>
          <div class="item item-input item-divider div bg-white" style="border-bottom: 0;">
            <i class="dark">货物拍照(选填)</i>
          </div>
          <div class="camera">
            <div ng-if="imgData!=undefined" ng-repeat="img in imgData">
              <img ng-src="{{img}}"/>
              <i class="icon ion-close-circled closeImg" ng-click="deleteImg(img)"></i>
            </div>
            <div ng-if="imgData.length<=2"  style="background-color: #ECEDF1;" ng-click="actionSheet()">
              <i class="icon ion-plus-round addImg"></i>
            </div>
          </div>
          <div class="item item-input item-divider div">
            <img src="img/fy_logo.png" class="typeIcon" style="height: 25px;">
            <i class="dark">费用</i>
          </div>
          <label class="item item-input item-select div">
            <i class="input-label col-25" >付款方式</i>
            <select id="paymentMethod">
              <option ng-repeat="i in paymentMethods" value="{{i.key}}">{{i.value}}</option>
            </select>
          </label>
          <label class="item item-input div">
            <i class="input-label col-25" >代收货款</i>
            <input type="number" class="twoDot txtRight" id="AGENCY_FUND" placeholder="请填写代收货款" ng-model="order.costMap.AGENCY_FUND" style="padding-right: 0px;" onkeypress="this.value = this.value.slice(0, 8)">
            <span class="company">元</span>
          </label>
          <label class="item item-input div">
            <i class="input-label col-25" >声明价值</i>
            <input type="number" class="twoDot txtRight" id="DECLARE_VALUE" placeholder="请填写声明价值" ng-model="order.costMap.DECLARE_VALUE" style="padding-right: 0px;" onkeypress="this.value = this.value.slice(0, 8)">
            <span class="company">元</span>
          </label>
          <ion-toggle class="col-50" ng-model="order.isPickup" style="width: 50%;float: left">
            <i class="text">是否提货</i>
          </ion-toggle>
          <ion-toggle class="col-50" ng-model="order.isInsure" style="width: 50%;float: left">
            <i class="text">是否投保</i>
          </ion-toggle>
          <ion-toggle ng-model="order.isReceipt">
            <i class="text">签收单</i>
          </ion-toggle>
          <div class="item item-input">
            <textarea type="text" placeholder="备注" maxlength="30" ng-model="order.remark" style="height: 80px;"></textarea>
          </div>
      </div>
  </ion-content>
  <ion-footer-bar class="btnDiv">
    <div class="btnDiv" style="margin-top: 2px;">
      <button class="button button-positive longButton" id="save" ng-click="addOrder()">立刻下单</button>
    </div>
  </ion-footer-bar>
</ion-view>
